/* ----------------------------------------------------------------------
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
*
* $Date:        19. March 2015
* $Revision:    V.1.4.5
*
* Project:      CMSIS DSP Library
* Title:        arm_rfft_init_q15.c
*
* Description:  RFFT & RIFFT Q15 initialisation function
*
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*   - Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*   - Redistributions in binary form must reproduce the above copyright
*     notice, this list of conditions and the following disclaimer in
*     the documentation and/or other materials provided with the
*     distribution.
*   - Neither the name of ARM LIMITED nor the names of its contributors
*     may be used to endorse or promote products derived from this
*     software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* -------------------------------------------------------------------- */


#include "arm_math.h"
#include "arm_common_tables.h"
#include "arm_const_structs.h"

/**
* @ingroup groupTransforms
*/

/**
* @addtogroup RealFFT
* @{
*/



/**
* \par
* Generation fixed-point realCoefAQ15 array in Q15 format:
* \par
* n = 4096
* <pre>for (i = 0; i < n; i++)
*  {
*    pATable[2 * i] = 0.5 * (1.0 - sin (2 * PI / (double) (2 * n) * (double) i));
*    pATable[2 * i + 1] = 0.5 * (-1.0 * cos (2 * PI / (double) (2 * n) * (double) i));
*  } </pre>
* \par
* Convert to fixed point Q15 format
*       round(pATable[i] * pow(2, 15))
*/
static const q15_t ALIGN4 realCoefAQ15[1024] = {
    0x4000, 0x3fce, 0x3f9b, 0x3f69, 0x3f37, 0x3f05, 0x3ed2, 0x3ea0,
    0x3e6e, 0x3e3c, 0x3e09, 0x3dd7, 0x3da5, 0x3d73, 0x3d40, 0x3d0e,
    0x3cdc, 0x3caa, 0x3c78, 0x3c45, 0x3c13, 0x3be1, 0x3baf, 0x3b7d,
    0x3b4b, 0x3b19, 0x3ae6, 0x3ab4, 0x3a82, 0x3a50, 0x3a1e, 0x39ec,
    0x39ba, 0x3988, 0x3956, 0x3924, 0x38f2, 0x38c0, 0x388e, 0x385c,
    0x382a, 0x37f9, 0x37c7, 0x3795, 0x3763, 0x3731, 0x36ff, 0x36ce,
    0x369c, 0x366a, 0x3639, 0x3607, 0x35d5, 0x35a4, 0x3572, 0x3540,
    0x350f, 0x34dd, 0x34ac, 0x347b, 0x3449, 0x3418, 0x33e6, 0x33b5,
    0x3384, 0x3352, 0x3321, 0x32f0, 0x32bf, 0x328e, 0x325c, 0x322b,
    0x31fa, 0x31c9, 0x3198, 0x3167, 0x3136, 0x3105, 0x30d5, 0x30a4,
    0x3073, 0x3042, 0x3012, 0x2fe1, 0x2fb0, 0x2f80, 0x2f4f, 0x2f1f,
    0x2eee, 0x2ebe, 0x2e8d, 0x2e5d, 0x2e2d, 0x2dfc, 0x2dcc, 0x2d9c,
    0x2d6c, 0x2d3c, 0x2d0c, 0x2cdc, 0x2cac, 0x2c7c, 0x2c4c, 0x2c1c,
    0x2bed, 0x2bbd, 0x2b8d, 0x2b5e, 0x2b2e, 0x2aff, 0x2acf, 0x2aa0,
    0x2a70, 0x2a41, 0x2a12, 0x29e3, 0x29b4, 0x2984, 0x2955, 0x2926,
    0x28f7, 0x28c9, 0x289a, 0x286b, 0x283c, 0x280e, 0x27df, 0x27b1,
    0x2782, 0x2754, 0x2725, 0x26f7, 0x26c9, 0x269b, 0x266d, 0x263f,
    0x2611, 0x25e3, 0x25b5, 0x2587, 0x2559, 0x252c, 0x24fe, 0x24d0,
    0x24a3, 0x2476, 0x2448, 0x241b, 0x23ee, 0x23c1, 0x2394, 0x2367,
    0x233a, 0x230d, 0x22e0, 0x22b3, 0x2287, 0x225a, 0x222d, 0x2201,
    0x21d5, 0x21a8, 0x217c, 0x2150, 0x2124, 0x20f8, 0x20cc, 0x20a0,
    0x2074, 0x2049, 0x201d, 0x1ff1, 0x1fc6, 0x1f9b, 0x1f6f, 0x1f44,
    0x1f19, 0x1eee, 0x1ec3, 0x1e98, 0x1e6d, 0x1e42, 0x1e18, 0x1ded,
    0x1dc3, 0x1d98, 0x1d6e, 0x1d44, 0x1d19, 0x1cef, 0x1cc5, 0x1c9b,
    0x1c72, 0x1c48, 0x1c1e, 0x1bf5, 0x1bcb, 0x1ba2, 0x1b78, 0x1b4f,
    0x1b26, 0x1afd, 0x1ad4, 0x1aab, 0x1a82, 0x1a5a, 0x1a31, 0x1a08,
    0x19e0, 0x19b8, 0x198f, 0x1967, 0x193f, 0x1917, 0x18ef, 0x18c8,
    0x18a0, 0x1878, 0x1851, 0x182a, 0x1802, 0x17db, 0x17b4, 0x178d,
    0x1766, 0x173f, 0x1719, 0x16f2, 0x16cb, 0x16a5, 0x167f, 0x1659,
    0x1632, 0x160c, 0x15e6, 0x15c1, 0x159b, 0x1575, 0x1550, 0x152a,
    0x1505, 0x14e0, 0x14bb, 0x1496, 0x1471, 0x144c, 0x1428, 0x1403,
    0x13df, 0x13ba, 0x1396, 0x1372, 0x134e, 0x132a, 0x1306, 0x12e2,
    0x12bf, 0x129b, 0x1278, 0x1255, 0x1231, 0x120e, 0x11eb, 0x11c9,
    0x11a6, 0x1183, 0x1161, 0x113e, 0x111c, 0x10fa, 0x10d8, 0x10b6,
    0x1094, 0x1073, 0x1051, 0x1030, 0x100e, 0xfed, 0xfcc, 0xfab,
    0xf8a, 0xf69, 0xf48, 0xf28, 0xf07, 0xee7, 0xec7, 0xea7,
    0xe87, 0xe67, 0xe47, 0xe28, 0xe08, 0xde9, 0xdca, 0xdab,
    0xd8c, 0xd6d, 0xd4e, 0xd30, 0xd11, 0xcf3, 0xcd4, 0xcb6,
    0xc98, 0xc7a, 0xc5d, 0xc3f, 0xc21, 0xc04, 0xbe7, 0xbca,
    0xbad, 0xb90, 0xb73, 0xb56, 0xb3a, 0xb1e, 0xb01, 0xae5,
    0xac9, 0xaad, 0xa92, 0xa76, 0xa5b, 0xa3f, 0xa24, 0xa09,
    0x9ee, 0x9d3, 0x9b8, 0x99e, 0x983, 0x969, 0x94f, 0x935,
    0x91b, 0x901, 0x8e8, 0x8ce, 0x8b5, 0x89b, 0x882, 0x869,
    0x850, 0x838, 0x81f, 0x807, 0x7ee, 0x7d6, 0x7be, 0x7a6,
    0x78f, 0x777, 0x75f, 0x748, 0x731, 0x71a, 0x703, 0x6ec,
    0x6d5, 0x6bf, 0x6a8, 0x692, 0x67c, 0x666, 0x650, 0x63b,
    0x625, 0x610, 0x5fa, 0x5e5, 0x5d0, 0x5bb, 0x5a7, 0x592,
    0x57e, 0x569, 0x555, 0x541, 0x52d, 0x51a, 0x506, 0x4f2,
    0x4df, 0x4cc, 0x4b9, 0x4a6, 0x493, 0x481, 0x46e, 0x45c,
    0x44a, 0x438, 0x426, 0x414, 0x403, 0x3f1, 0x3e0, 0x3cf,
    0x3be, 0x3ad, 0x39c, 0x38c, 0x37b, 0x36b, 0x35b, 0x34b,
    0x33b, 0x32b, 0x31c, 0x30c, 0x2fd, 0x2ee, 0x2df, 0x2d0,
    0x2c1, 0x2b3, 0x2a5, 0x296, 0x288, 0x27a, 0x26d, 0x25f,
    0x251, 0x244, 0x237, 0x22a, 0x21d, 0x210, 0x204, 0x1f7,
    0x1eb, 0x1df, 0x1d3, 0x1c7, 0x1bb, 0x1b0, 0x1a4, 0x199,
    0x18e, 0x183, 0x178, 0x16e, 0x163, 0x159, 0x14f, 0x145,
    0x13b, 0x131, 0x128, 0x11e, 0x115, 0x10c, 0x103, 0xfa,
    0xf1, 0xe9, 0xe0, 0xd8, 0xd0, 0xc8, 0xc0, 0xb9,
    0xb1, 0xaa, 0xa3, 0x9c, 0x95, 0x8e, 0x88, 0x81,
    0x7b, 0x75, 0x6f, 0x69, 0x64, 0x5e, 0x59, 0x54,
    0x4f, 0x4a, 0x45, 0x41, 0x3c, 0x38, 0x34, 0x30,
    0x2c, 0x29, 0x25, 0x22, 0x1f, 0x1c, 0x19, 0x16,
    0x14, 0x11, 0xf, 0xd, 0xb, 0x9, 0x8, 0x6,
    0x5, 0x4, 0x3, 0x2, 0x1, 0x1, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x1, 0x1, 0x2, 0x3, 0x4,
    0x5, 0x6, 0x8, 0x9, 0xb, 0xd, 0xf, 0x11,
    0x14, 0x16, 0x19, 0x1c, 0x1f, 0x22, 0x25, 0x29,
    0x2c, 0x30, 0x34, 0x38, 0x3c, 0x41, 0x45, 0x4a,
    0x4f, 0x54, 0x59, 0x5e, 0x64, 0x69, 0x6f, 0x75,
    0x7b, 0x81, 0x88, 0x8e, 0x95, 0x9c, 0xa3, 0xaa,
    0xb1, 0xb9, 0xc0, 0xc8, 0xd0, 0xd8, 0xe0, 0xe9,
    0xf1, 0xfa, 0x103, 0x10c, 0x115, 0x11e, 0x128, 0x131,
    0x13b, 0x145, 0x14f, 0x159, 0x163, 0x16e, 0x178, 0x183,
    0x18e, 0x199, 0x1a4, 0x1b0, 0x1bb, 0x1c7, 0x1d3, 0x1df,
    0x1eb, 0x1f7, 0x204, 0x210, 0x21d, 0x22a, 0x237, 0x244,
    0x251, 0x25f, 0x26d, 0x27a, 0x288, 0x296, 0x2a5, 0x2b3,
    0x2c1, 0x2d0, 0x2df, 0x2ee, 0x2fd, 0x30c, 0x31c, 0x32b,
    0x33b, 0x34b, 0x35b, 0x36b, 0x37b, 0x38c, 0x39c, 0x3ad,
    0x3be, 0x3cf, 0x3e0, 0x3f1, 0x403, 0x414, 0x426, 0x438,
    0x44a, 0x45c, 0x46e, 0x481, 0x493, 0x4a6, 0x4b9, 0x4cc,
    0x4df, 0x4f2, 0x506, 0x51a, 0x52d, 0x541, 0x555, 0x569,
    0x57e, 0x592, 0x5a7, 0x5bb, 0x5d0, 0x5e5, 0x5fa, 0x610,
    0x625, 0x63b, 0x650, 0x666, 0x67c, 0x692, 0x6a8, 0x6bf,
    0x6d5, 0x6ec, 0x703, 0x71a, 0x731, 0x748, 0x75f, 0x777,
    0x78f, 0x7a6, 0x7be, 0x7d6, 0x7ee, 0x807, 0x81f, 0x838,
    0x850, 0x869, 0x882, 0x89b, 0x8b5, 0x8ce, 0x8e8, 0x901,
    0x91b, 0x935, 0x94f, 0x969, 0x983, 0x99e, 0x9b8, 0x9d3,
    0x9ee, 0xa09, 0xa24, 0xa3f, 0xa5b, 0xa76, 0xa92, 0xaad,
    0xac9, 0xae5, 0xb01, 0xb1e, 0xb3a, 0xb56, 0xb73, 0xb90,
    0xbad, 0xbca, 0xbe7, 0xc04, 0xc21, 0xc3f, 0xc5d, 0xc7a,
    0xc98, 0xcb6, 0xcd4, 0xcf3, 0xd11, 0xd30, 0xd4e, 0xd6d,
    0xd8c, 0xdab, 0xdca, 0xde9, 0xe08, 0xe28, 0xe47, 0xe67,
    0xe87, 0xea7, 0xec7, 0xee7, 0xf07, 0xf28, 0xf48, 0xf69,
    0xf8a, 0xfab, 0xfcc, 0xfed, 0x100e, 0x1030, 0x1051, 0x1073,
    0x1094, 0x10b6, 0x10d8, 0x10fa, 0x111c, 0x113e, 0x1161, 0x1183,
    0x11a6, 0x11c9, 0x11eb, 0x120e, 0x1231, 0x1255, 0x1278, 0x129b,
    0x12bf, 0x12e2, 0x1306, 0x132a, 0x134e, 0x1372, 0x1396, 0x13ba,
    0x13df, 0x1403, 0x1428, 0x144c, 0x1471, 0x1496, 0x14bb, 0x14e0,
    0x1505, 0x152a, 0x1550, 0x1575, 0x159b, 0x15c1, 0x15e6, 0x160c,
    0x1632, 0x1659, 0x167f, 0x16a5, 0x16cb, 0x16f2, 0x1719, 0x173f,
    0x1766, 0x178d, 0x17b4, 0x17db, 0x1802, 0x182a, 0x1851, 0x1878,
    0x18a0, 0x18c8, 0x18ef, 0x1917, 0x193f, 0x1967, 0x198f, 0x19b8,
    0x19e0, 0x1a08, 0x1a31, 0x1a5a, 0x1a82, 0x1aab, 0x1ad4, 0x1afd,
    0x1b26, 0x1b4f, 0x1b78, 0x1ba2, 0x1bcb, 0x1bf5, 0x1c1e, 0x1c48,
    0x1c72, 0x1c9b, 0x1cc5, 0x1cef, 0x1d19, 0x1d44, 0x1d6e, 0x1d98,
    0x1dc3, 0x1ded, 0x1e18, 0x1e42, 0x1e6d, 0x1e98, 0x1ec3, 0x1eee,
    0x1f19, 0x1f44, 0x1f6f, 0x1f9b, 0x1fc6, 0x1ff1, 0x201d, 0x2049,
    0x2074, 0x20a0, 0x20cc, 0x20f8, 0x2124, 0x2150, 0x217c, 0x21a8,
    0x21d5, 0x2201, 0x222d, 0x225a, 0x2287, 0x22b3, 0x22e0, 0x230d,
    0x233a, 0x2367, 0x2394, 0x23c1, 0x23ee, 0x241b, 0x2448, 0x2476,
    0x24a3, 0x24d0, 0x24fe, 0x252c, 0x2559, 0x2587, 0x25b5, 0x25e3,
    0x2611, 0x263f, 0x266d, 0x269b, 0x26c9, 0x26f7, 0x2725, 0x2754,
    0x2782, 0x27b1, 0x27df, 0x280e, 0x283c, 0x286b, 0x289a, 0x28c9,
    0x28f7, 0x2926, 0x2955, 0x2984, 0x29b4, 0x29e3, 0x2a12, 0x2a41,
    0x2a70, 0x2aa0, 0x2acf, 0x2aff, 0x2b2e, 0x2b5e, 0x2b8d, 0x2bbd,
    0x2bed, 0x2c1c, 0x2c4c, 0x2c7c, 0x2cac, 0x2cdc, 0x2d0c, 0x2d3c,
    0x2d6c, 0x2d9c, 0x2dcc, 0x2dfc, 0x2e2d, 0x2e5d, 0x2e8d, 0x2ebe,
    0x2eee, 0x2f1f, 0x2f4f, 0x2f80, 0x2fb0, 0x2fe1, 0x3012, 0x3042,
    0x3073, 0x30a4, 0x30d5, 0x3105, 0x3136, 0x3167, 0x3198, 0x31c9,
    0x31fa, 0x322b, 0x325c, 0x328e, 0x32bf, 0x32f0, 0x3321, 0x3352,
    0x3384, 0x33b5, 0x33e6, 0x3418, 0x3449, 0x347b, 0x34ac, 0x34dd,
    0x350f, 0x3540, 0x3572, 0x35a4, 0x35d5, 0x3607, 0x3639, 0x366a,
    0x369c, 0x36ce, 0x36ff, 0x3731, 0x3763, 0x3795, 0x37c7, 0x37f9,
    0x382a, 0x385c, 0x388e, 0x38c0, 0x38f2, 0x3924, 0x3956, 0x3988,
    0x39ba, 0x39ec, 0x3a1e, 0x3a50, 0x3a82, 0x3ab4, 0x3ae6, 0x3b19,
    0x3b4b, 0x3b7d, 0x3baf, 0x3be1, 0x3c13, 0x3c45, 0x3c78, 0x3caa,
    0x3cdc, 0x3d0e, 0x3d40, 0x3d73, 0x3da5, 0x3dd7, 0x3e09, 0x3e3c,
    0x3e6e, 0x3ea0, 0x3ed2, 0x3f05, 0x3f37, 0x3f69, 0x3f9b, 0x3fce,
};

/**
* \par
* Generation of real_CoefB array:
* \par
* n = 4096
* <pre>for (i = 0; i < n; i++)
*  {
*    pBTable[2 * i] = 0.5 * (1.0 + sin (2 * PI / (double) (2 * n) * (double) i));
*    pBTable[2 * i + 1] = 0.5 * (1.0 * cos (2 * PI / (double) (2 * n) * (double) i));
*  } </pre>
* \par
* Convert to fixed point Q15 format
*       round(pBTable[i] * pow(2, 15))
*
*/
static const q15_t ALIGN4 realCoefBQ15[1024] = {
    0x4000, 0x4032, 0x4065, 0x4097, 0x40c9, 0x40fb, 0x412e, 0x4160,
    0x4192, 0x41c4, 0x41f7, 0x4229, 0x425b, 0x428d, 0x42c0, 0x42f2,
    0x4324, 0x4356, 0x4388, 0x43bb, 0x43ed, 0x441f, 0x4451, 0x4483,
    0x44b5, 0x44e7, 0x451a, 0x454c, 0x457e, 0x45b0, 0x45e2, 0x4614,
    0x4646, 0x4678, 0x46aa, 0x46dc, 0x470e, 0x4740, 0x4772, 0x47a4,
    0x47d6, 0x4807, 0x4839, 0x486b, 0x489d, 0x48cf, 0x4901, 0x4932,
    0x4964, 0x4996, 0x49c7, 0x49f9, 0x4a2b, 0x4a5c, 0x4a8e, 0x4ac0,
    0x4af1, 0x4b23, 0x4b54, 0x4b85, 0x4bb7, 0x4be8, 0x4c1a, 0x4c4b,
    0x4c7c, 0x4cae, 0x4cdf, 0x4d10, 0x4d41, 0x4d72, 0x4da4, 0x4dd5,
    0x4e06, 0x4e37, 0x4e68, 0x4e99, 0x4eca, 0x4efb, 0x4f2b, 0x4f5c,
    0x4f8d, 0x4fbe, 0x4fee, 0x501f, 0x5050, 0x5080, 0x50b1, 0x50e1,
    0x5112, 0x5142, 0x5173, 0x51a3, 0x51d3, 0x5204, 0x5234, 0x5264,
    0x5294, 0x52c4, 0x52f4, 0x5324, 0x5354, 0x5384, 0x53b4, 0x53e4,
    0x5413, 0x5443, 0x5473, 0x54a2, 0x54d2, 0x5501, 0x5531, 0x5560,
    0x5590, 0x55bf, 0x55ee, 0x561d, 0x564c, 0x567c, 0x56ab, 0x56da,
    0x5709, 0x5737, 0x5766, 0x5795, 0x57c4, 0x57f2, 0x5821, 0x584f,
    0x587e, 0x58ac, 0x58db, 0x5909, 0x5937, 0x5965, 0x5993, 0x59c1,
    0x59ef, 0x5a1d, 0x5a4b, 0x5a79, 0x5aa7, 0x5ad4, 0x5b02, 0x5b30,
    0x5b5d, 0x5b8a, 0x5bb8, 0x5be5, 0x5c12, 0x5c3f, 0x5c6c, 0x5c99,
    0x5cc6, 0x5cf3, 0x5d20, 0x5d4d, 0x5d79, 0x5da6, 0x5dd3, 0x5dff,
    0x5e2b, 0x5e58, 0x5e84, 0x5eb0, 0x5edc, 0x5f08, 0x5f34, 0x5f60,
    0x5f8c, 0x5fb7, 0x5fe3, 0x600f, 0x603a, 0x6065, 0x6091, 0x60bc,
    0x60e7, 0x6112, 0x613d, 0x6168, 0x6193, 0x61be, 0x61e8, 0x6213,
    0x623d, 0x6268, 0x6292, 0x62bc, 0x62e7, 0x6311, 0x633b, 0x6365,
    0x638e, 0x63b8, 0x63e2, 0x640b, 0x6435, 0x645e, 0x6488, 0x64b1,
    0x64da, 0x6503, 0x652c, 0x6555, 0x657e, 0x65a6, 0x65cf, 0x65f8,
    0x6620, 0x6648, 0x6671, 0x6699, 0x66c1, 0x66e9, 0x6711, 0x6738,
    0x6760, 0x6788, 0x67af, 0x67d6, 0x67fe, 0x6825, 0x684c, 0x6873,
    0x689a, 0x68c1, 0x68e7, 0x690e, 0x6935, 0x695b, 0x6981, 0x69a7,
    0x69ce, 0x69f4, 0x6a1a, 0x6a3f, 0x6a65, 0x6a8b, 0x6ab0, 0x6ad6,
    0x6afb, 0x6b20, 0x6b45, 0x6b6a, 0x6b8f, 0x6bb4, 0x6bd8, 0x6bfd,
    0x6c21, 0x6c46, 0x6c6a, 0x6c8e, 0x6cb2, 0x6cd6, 0x6cfa, 0x6d1e,
    0x6d41, 0x6d65, 0x6d88, 0x6dab, 0x6dcf, 0x6df2, 0x6e15, 0x6e37,
    0x6e5a, 0x6e7d, 0x6e9f, 0x6ec2, 0x6ee4, 0x6f06, 0x6f28, 0x6f4a,
    0x6f6c, 0x6f8d, 0x6faf, 0x6fd0, 0x6ff2, 0x7013, 0x7034, 0x7055,
    0x7076, 0x7097, 0x70b8, 0x70d8, 0x70f9, 0x7119, 0x7139, 0x7159,
    0x7179, 0x7199, 0x71b9, 0x71d8, 0x71f8, 0x7217, 0x7236, 0x7255,
    0x7274, 0x7293, 0x72b2, 0x72d0, 0x72ef, 0x730d, 0x732c, 0x734a,
    0x7368, 0x7386, 0x73a3, 0x73c1, 0x73df, 0x73fc, 0x7419, 0x7436,
    0x7453, 0x7470, 0x748d, 0x74aa, 0x74c6, 0x74e2, 0x74ff, 0x751b,
    0x7537, 0x7553, 0x756e, 0x758a, 0x75a5, 0x75c1, 0x75dc, 0x75f7,
    0x7612, 0x762d, 0x7648, 0x7662, 0x767d, 0x7697, 0x76b1, 0x76cb,
    0x76e5, 0x76ff, 0x7718, 0x7732, 0x774b, 0x7765, 0x777e, 0x7797,
    0x77b0, 0x77c8, 0x77e1, 0x77f9, 0x7812, 0x782a, 0x7842, 0x785a,
    0x7871, 0x7889, 0x78a1, 0x78b8, 0x78cf, 0x78e6, 0x78fd, 0x7914,
    0x792b, 0x7941, 0x7958, 0x796e, 0x7984, 0x799a, 0x79b0, 0x79c5,
    0x79db, 0x79f0, 0x7a06, 0x7a1b, 0x7a30, 0x7a45, 0x7a59, 0x7a6e,
    0x7a82, 0x7a97, 0x7aab, 0x7abf, 0x7ad3, 0x7ae6, 0x7afa, 0x7b0e,
    0x7b21, 0x7b34, 0x7b47, 0x7b5a, 0x7b6d, 0x7b7f, 0x7b92, 0x7ba4,
    0x7bb6, 0x7bc8, 0x7bda, 0x7bec, 0x7bfd, 0x7c0f, 0x7c20, 0x7c31,
    0x7c42, 0x7c53, 0x7c64, 0x7c74, 0x7c85, 0x7c95, 0x7ca5, 0x7cb5,
    0x7cc5, 0x7cd5, 0x7ce4, 0x7cf4, 0x7d03, 0x7d12, 0x7d21, 0x7d30,
    0x7d3f, 0x7d4d, 0x7d5b, 0x7d6a, 0x7d78, 0x7d86, 0x7d93, 0x7da1,
    0x7daf, 0x7dbc, 0x7dc9, 0x7dd6, 0x7de3, 0x7df0, 0x7dfc, 0x7e09,
    0x7e15, 0x7e21, 0x7e2d, 0x7e39, 0x7e45, 0x7e50, 0x7e5c, 0x7e67,
    0x7e72, 0x7e7d, 0x7e88, 0x7e92, 0x7e9d, 0x7ea7, 0x7eb1, 0x7ebb,
    0x7ec5, 0x7ecf, 0x7ed8, 0x7ee2, 0x7eeb, 0x7ef4, 0x7efd, 0x7f06,
    0x7f0f, 0x7f17, 0x7f20, 0x7f28, 0x7f30, 0x7f38, 0x7f40, 0x7f47,
    0x7f4f, 0x7f56, 0x7f5d, 0x7f64, 0x7f6b, 0x7f72, 0x7f78, 0x7f7f,
    0x7f85, 0x7f8b, 0x7f91, 0x7f97, 0x7f9c, 0x7fa2, 0x7fa7, 0x7fac,
    0x7fb1, 0x7fb6, 0x7fbb, 0x7fbf, 0x7fc4, 0x7fc8, 0x7fcc, 0x7fd0,
    0x7fd4, 0x7fd7, 0x7fdb, 0x7fde, 0x7fe1, 0x7fe4, 0x7fe7, 0x7fea,
    0x7fec, 0x7fef, 0x7ff1, 0x7ff3, 0x7ff5, 0x7ff7, 0x7ff8, 0x7ffa,
    0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
    0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7ffe, 0x7ffd, 0x7ffc,
    0x7ffb, 0x7ffa, 0x7ff8, 0x7ff7, 0x7ff5, 0x7ff3, 0x7ff1, 0x7fef,
    0x7fec, 0x7fea, 0x7fe7, 0x7fe4, 0x7fe1, 0x7fde, 0x7fdb, 0x7fd7,
    0x7fd4, 0x7fd0, 0x7fcc, 0x7fc8, 0x7fc4, 0x7fbf, 0x7fbb, 0x7fb6,
    0x7fb1, 0x7fac, 0x7fa7, 0x7fa2, 0x7f9c, 0x7f97, 0x7f91, 0x7f8b,
    0x7f85, 0x7f7f, 0x7f78, 0x7f72, 0x7f6b, 0x7f64, 0x7f5d, 0x7f56,
    0x7f4f, 0x7f47, 0x7f40, 0x7f38, 0x7f30, 0x7f28, 0x7f20, 0x7f17,
    0x7f0f, 0x7f06, 0x7efd, 0x7ef4, 0x7eeb, 0x7ee2, 0x7ed8, 0x7ecf,
    0x7ec5, 0x7ebb, 0x7eb1, 0x7ea7, 0x7e9d, 0x7e92, 0x7e88, 0x7e7d,
    0x7e72, 0x7e67, 0x7e5c, 0x7e50, 0x7e45, 0x7e39, 0x7e2d, 0x7e21,
    0x7e15, 0x7e09, 0x7dfc, 0x7df0, 0x7de3, 0x7dd6, 0x7dc9, 0x7dbc,
    0x7daf, 0x7da1, 0x7d93, 0x7d86, 0x7d78, 0x7d6a, 0x7d5b, 0x7d4d,
    0x7d3f, 0x7d30, 0x7d21, 0x7d12, 0x7d03, 0x7cf4, 0x7ce4, 0x7cd5,
    0x7cc5, 0x7cb5, 0x7ca5, 0x7c95, 0x7c85, 0x7c74, 0x7c64, 0x7c53,
    0x7c42, 0x7c31, 0x7c20, 0x7c0f, 0x7bfd, 0x7bec, 0x7bda, 0x7bc8,
    0x7bb6, 0x7ba4, 0x7b92, 0x7b7f, 0x7b6d, 0x7b5a, 0x7b47, 0x7b34,
    0x7b21, 0x7b0e, 0x7afa, 0x7ae6, 0x7ad3, 0x7abf, 0x7aab, 0x7a97,
    0x7a82, 0x7a6e, 0x7a59, 0x7a45, 0x7a30, 0x7a1b, 0x7a06, 0x79f0,
    0x79db, 0x79c5, 0x79b0, 0x799a, 0x7984, 0x796e, 0x7958, 0x7941,
    0x792b, 0x7914, 0x78fd, 0x78e6, 0x78cf, 0x78b8, 0x78a1, 0x7889,
    0x7871, 0x785a, 0x7842, 0x782a, 0x7812, 0x77f9, 0x77e1, 0x77c8,
    0x77b0, 0x7797, 0x777e, 0x7765, 0x774b, 0x7732, 0x7718, 0x76ff,
    0x76e5, 0x76cb, 0x76b1, 0x7697, 0x767d, 0x7662, 0x7648, 0x762d,
    0x7612, 0x75f7, 0x75dc, 0x75c1, 0x75a5, 0x758a, 0x756e, 0x7553,
    0x7537, 0x751b, 0x74ff, 0x74e2, 0x74c6, 0x74aa, 0x748d, 0x7470,
    0x7453, 0x7436, 0x7419, 0x73fc, 0x73df, 0x73c1, 0x73a3, 0x7386,
    0x7368, 0x734a, 0x732c, 0x730d, 0x72ef, 0x72d0, 0x72b2, 0x7293,
    0x7274, 0x7255, 0x7236, 0x7217, 0x71f8, 0x71d8, 0x71b9, 0x7199,
    0x7179, 0x7159, 0x7139, 0x7119, 0x70f9, 0x70d8, 0x70b8, 0x7097,
    0x7076, 0x7055, 0x7034, 0x7013, 0x6ff2, 0x6fd0, 0x6faf, 0x6f8d,
    0x6f6c, 0x6f4a, 0x6f28, 0x6f06, 0x6ee4, 0x6ec2, 0x6e9f, 0x6e7d,
    0x6e5a, 0x6e37, 0x6e15, 0x6df2, 0x6dcf, 0x6dab, 0x6d88, 0x6d65,
    0x6d41, 0x6d1e, 0x6cfa, 0x6cd6, 0x6cb2, 0x6c8e, 0x6c6a, 0x6c46,
    0x6c21, 0x6bfd, 0x6bd8, 0x6bb4, 0x6b8f, 0x6b6a, 0x6b45, 0x6b20,
    0x6afb, 0x6ad6, 0x6ab0, 0x6a8b, 0x6a65, 0x6a3f, 0x6a1a, 0x69f4,
    0x69ce, 0x69a7, 0x6981, 0x695b, 0x6935, 0x690e, 0x68e7, 0x68c1,
    0x689a, 0x6873, 0x684c, 0x6825, 0x67fe, 0x67d6, 0x67af, 0x6788,
    0x6760, 0x6738, 0x6711, 0x66e9, 0x66c1, 0x6699, 0x6671, 0x6648,
    0x6620, 0x65f8, 0x65cf, 0x65a6, 0x657e, 0x6555, 0x652c, 0x6503,
    0x64da, 0x64b1, 0x6488, 0x645e, 0x6435, 0x640b, 0x63e2, 0x63b8,
    0x638e, 0x6365, 0x633b, 0x6311, 0x62e7, 0x62bc, 0x6292, 0x6268,
    0x623d, 0x6213, 0x61e8, 0x61be, 0x6193, 0x6168, 0x613d, 0x6112,
    0x60e7, 0x60bc, 0x6091, 0x6065, 0x603a, 0x600f, 0x5fe3, 0x5fb7,
    0x5f8c, 0x5f60, 0x5f34, 0x5f08, 0x5edc, 0x5eb0, 0x5e84, 0x5e58,
    0x5e2b, 0x5dff, 0x5dd3, 0x5da6, 0x5d79, 0x5d4d, 0x5d20, 0x5cf3,
    0x5cc6, 0x5c99, 0x5c6c, 0x5c3f, 0x5c12, 0x5be5, 0x5bb8, 0x5b8a,
    0x5b5d, 0x5b30, 0x5b02, 0x5ad4, 0x5aa7, 0x5a79, 0x5a4b, 0x5a1d,
    0x59ef, 0x59c1, 0x5993, 0x5965, 0x5937, 0x5909, 0x58db, 0x58ac,
    0x587e, 0x584f, 0x5821, 0x57f2, 0x57c4, 0x5795, 0x5766, 0x5737,
    0x5709, 0x56da, 0x56ab, 0x567c, 0x564c, 0x561d, 0x55ee, 0x55bf,
    0x5590, 0x5560, 0x5531, 0x5501, 0x54d2, 0x54a2, 0x5473, 0x5443,
    0x5413, 0x53e4, 0x53b4, 0x5384, 0x5354, 0x5324, 0x52f4, 0x52c4,
    0x5294, 0x5264, 0x5234, 0x5204, 0x51d3, 0x51a3, 0x5173, 0x5142,
    0x5112, 0x50e1, 0x50b1, 0x5080, 0x5050, 0x501f, 0x4fee, 0x4fbe,
    0x4f8d, 0x4f5c, 0x4f2b, 0x4efb, 0x4eca, 0x4e99, 0x4e68, 0x4e37,
    0x4e06, 0x4dd5, 0x4da4, 0x4d72, 0x4d41, 0x4d10, 0x4cdf, 0x4cae,
    0x4c7c, 0x4c4b, 0x4c1a, 0x4be8, 0x4bb7, 0x4b85, 0x4b54, 0x4b23,
    0x4af1, 0x4ac0, 0x4a8e, 0x4a5c, 0x4a2b, 0x49f9, 0x49c7, 0x4996,
    0x4964, 0x4932, 0x4901, 0x48cf, 0x489d, 0x486b, 0x4839, 0x4807,
    0x47d6, 0x47a4, 0x4772, 0x4740, 0x470e, 0x46dc, 0x46aa, 0x4678,
    0x4646, 0x4614, 0x45e2, 0x45b0, 0x457e, 0x454c, 0x451a, 0x44e7,
    0x44b5, 0x4483, 0x4451, 0x441f, 0x43ed, 0x43bb, 0x4388, 0x4356,
    0x4324, 0x42f2, 0x42c0, 0x428d, 0x425b, 0x4229, 0x41f7, 0x41c4,
    0x4192, 0x4160, 0x412e, 0x40fb, 0x40c9, 0x4097, 0x4065, 0x4032,
};

/**
* @brief  Initialization function for the Q15 RFFT/RIFFT.
* @param[in, out] *S             points to an instance of the Q15 RFFT/RIFFT structure.
* @param[in]      fftLenReal     length of the FFT.
* @param[in]      ifftFlagR      flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform.
* @param[in]      bitReverseFlag flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output.
* @return       The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if <code>fftLenReal</code> is not a supported value.
*
* \par Description:
* \par
* The parameter <code>fftLenReal</code> Specifies length of RFFT/RIFFT Process. Supported FFT Lengths are 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192.
* \par
* The parameter <code>ifftFlagR</code> controls whether a forward or inverse transform is computed.
* Set(=1) ifftFlagR to calculate RIFFT, otherwise RFFT is calculated.
* \par
* The parameter <code>bitReverseFlag</code> controls whether output is in normal order or bit reversed order.
* Set(=1) bitReverseFlag for output to be in normal order otherwise output is in bit reversed order.
* \par
* This function also initializes Twiddle factor table.
*/
arm_status arm_rfft_init_q15_1024(
    arm_rfft_instance_q15 *S,
    uint32_t fftLenReal,
    uint32_t ifftFlagR,
    uint32_t bitReverseFlag)
{
    /*  Initialise the default arm status */
    arm_status status = ARM_MATH_SUCCESS;

    /*  Initialize the Real FFT length */
    S->fftLenReal = (uint16_t) fftLenReal;

    /*  Initialize the Twiddle coefficientA pointer */
    S->pTwiddleAReal = (q15_t *) realCoefAQ15;

    /*  Initialize the Twiddle coefficientB pointer */
    S->pTwiddleBReal = (q15_t *) realCoefBQ15;

    /*  Initialize the Flag for selection of RFFT or RIFFT */
    S->ifftFlagR = (uint8_t) ifftFlagR;

    /*  Initialize the Flag for calculation Bit reversal or not */
    S->bitReverseFlagR = (uint8_t) bitReverseFlag;

    /*  Initialization of coef modifier depending on the FFT length */
    switch (S->fftLenReal) {
    case 1024u:
        S->twidCoefRModifier = 1u;
        S->pCfft = &arm_cfft_sR_q15_len512;
        break;
    case 512u:
        S->twidCoefRModifier = 2u;
        S->pCfft = &arm_cfft_sR_q15_len256;
        break;
    case 256u:
        S->twidCoefRModifier = 4u;
        S->pCfft = &arm_cfft_sR_q15_len128;
        break;
    case 128u:
        S->twidCoefRModifier = 8u;
        S->pCfft = &arm_cfft_sR_q15_len64;
        break;
    case 64u:
        S->twidCoefRModifier = 16u;
        S->pCfft = &arm_cfft_sR_q15_len32;
        break;
    case 32u:
        S->twidCoefRModifier = 32u;
        S->pCfft = &arm_cfft_sR_q15_len16;
        break;
    default:
        /*  Reporting argument error if rfftSize is not valid value */
        status = ARM_MATH_ARGUMENT_ERROR;
        break;
    }

    /* return the status of RFFT Init function */
    return (status);
}

/**
* @} end of RealFFT group
*/
